<template>

  <div class="wrapper">
    <div class="success-logo">
      <van-icon name="todo-list" color="#4DE8A0" size="4rem" />
    </div>
    
      <p class="pay-success">支付成功</p>
      <p class="pay-log">支付单号:{{num}}</p>

    <div class="btn-group">
      <van-button type="primary" @click="handleBookDetail" size="small" style="margin-right: 10px;padding: 0 20px">查询详情</van-button>
      <van-button color="#ff6034" to="/book/list" size="small" style="padding: 0 20px">我的订单</van-button>
    </div>
  </div>

</template>

<script setup lang="ts">
import {useRoute,useRouter} from "vue-router"
const route = useRoute();
const router = useRouter();
const num = route.query.out_trade_no;

if(!num){
  showNotify({ type: 'danger', message: '参数错误' });
}

const handleBookDetail=()=>{
  if(!num){
    showNotify({ type: 'danger', message: '参数错误' });
  }
  router.push({"path":"/book/"+num});
}

</script>

<style scoped>

.wrapper{
  padding-top: 40px;
  box-sizing: border-box;
}

.wrapper .success-logo{
  text-align: center;
}

.wrapper .pay-success{
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  padding-top: 10px;
  padding-bottom: 4px;
  color: #8c939d;
}

.wrapper .pay-log{
  text-align: center;
  font-size: 12px;
  color: #8c939d;
}

.wrapper .btn-group{
  display: flex;
  justify-content: center;
  margin-top: 20px;
}



</style>